1. Field of the Invention
The present invention relates generally to compression technologies, and more specifically to a method and apparatus for decoding variable length codes (e.g., Huffman Encoding) while using optimal resources.
2. Related Art
Symbols are often encoded using variable length codes. Huffman encoding provides an example approach to such encoding. Variable length encoding has been used in several environments, typically due to the loss-less nature and the level of compression achieved.
In a typical scenario, an encoder encodes each input symbol to a corresponding bit string (code-word) using a pre-specified table, with the length of code-word potentially being different for different input symbols. In general, short length code-words are chosen for frequently occurring input symbols. A decoder then receives a bit stream containing such variable length code-words and constructs the symbols by using the inverse encoding tables (or corresponding information).
The decoding technique may need to be implemented while meeting various constraints in the corresponding environments. For example, in devices using VLIW (very large instruction word) processors, it may be desirable to avoid if conditions in the decoding operation. In addition, it may be desirable that the input characters be constructed quickly (using minimal processing power).
In the drawings, like reference numbers generally indicate identical, functionally similar, and/or structurally similar elements. The drawing in which an element first appears is indicated by the leftmost digit(s) in the corresponding reference number.